<include file="Public:header" />
<div class="container main">
    <include file="Public:left" />
    <div class="w790">
        <h1>
            <a href="{:U('index')}">
                返回列表
            </a>
        </h1>
        <form class="checkoutform" action="{:U('update')}" method="post">
            <input type="hidden" name="id" value="{$info.id}" />
            <table class="table table-bordered" width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td align="right">规则分类</td>
                    <td><span style="height:400px; width:100%;">
                        <input name="name" type="text" id="name" value="{$info.name}" />
                        </span></td>
                </tr>
                <tr>
                    <td align="right">积分数量</td>
                    <td><span style="height:400px; width:100%;">
                        <input name="integralnum" type="number" id="integralnum" value="{$info.integralnum}" />
                        </span></td>
                </tr>
                <tr>
                    <td align="right">父级组</td>
                    <td>
                        <select class="form-control" name="type_id" id="type_id" >
                            <volist name="ruletype" id="vo">
                                <option <eq name="vo['id']" value="$info['type_id']">selected="selected"</eq> value="{$vo.id}">{$vo.name}</option>
                            </volist>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td align="right">积分类型</td>
                    <td>
                        <select class="form-control" name="is_important" id="is_important" >
                            <option value="0">普通规则</option>
                            <option value="1">核心规则</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td align="right">审核人</td>
                    <td>
                        <select class="form-control f-membergroup" >
                        	<option>请选择部门</option>
                            <volist name="membergroup" id="vo">
                                <option value="{$vo.id}">{$vo.title}</option>
                            </volist>
                        </select>
                        <select class="form-control f-memberid" name="member_id" id="member_id" >
                            <option>请选择员工</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td align="right">备注</td>
                    <td><span style="height:400px; width:100%;">
                        <textarea name="remark" cols="50" rows="6" id="remark">{$info.remark}</textarea>
                        </span></td>
                </tr>
                <tr>
                    <td colspan="2" align="center"><button type="submit">提交</button></td>
                </tr>
            </table>
        </form>
    </div>
    <div class="clear">
    </div>
</div>
<script>
//当部门改变，显示相应部门的员工
$(".f-membergroup").change(function(e) {
	$.getJSON("{:U('getmember')}",{'groupid':$(this).val()},function(data){
		if(data.statu!=1){return;}
		$(".f-memberid").html('<option value="">请选择</option>');
		$(data.member).each(function(index, element) {
			$(".f-memberid").append('<option value="'+element.id+'">'+element.name+'</option>');
		});
   });
}); 
</script>
</body></html>